<template>
    <div class="list-container">
        <div class="sortList clearfix">
            <div class="center">

                <!--banner轮播-->
                <Carsousel :list="bannerList"/>
            </div>
            <div class="right">
                <div class="news">
                    <h4>
                        <em class="fl">轻聊问答</em>
                        <span class="fr tip">更多 ></span>
                    </h4>
                    <div class="clearix"></div>
                    <ul class="news-list unstyled">
                        <li>
                            <span class="bold">①</span>【女力觉醒】女性如何摆脱“性羞耻”心理？
                        </li>
                        <li>
                            <span class="bold">②</span>面对一个要受相同伤害的小孩，我应该怎么办？
                        </li>
                        <li>
                            <span class="bold">③</span>心累，工作得不开心，却又不舍放弃，特别纠结怎么办？
                        </li>
                        <li>
                            <span class="bold">④</span>对任何要求来者不拒，如何改变自己老好人的处境？
                        </li>
                        <li>
                            <span class="bold">⑤</span>越来越多的30+女性，正在不停榨干自己
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import {mapState} from 'vuex';

    export default {
        name: "ListContainer",
        mounted() {
            // 派发action:通过Vuex向ajax发送请求    经数据存储在仓库中
            this.$store.dispatch('getBannerList');
        },
        computed: {
            ...mapState({
                bannerList: state => state.home.bannerList,
            }),
        },

    }
</script>

<style lang="less" scoped>
    /*style书写组建的样式*/
    .list-container {
        width: 1200px;
        margin: 0 auto;

        .sortList {
            height: 464px;
            padding-left: 210px;

            .center {
                box-sizing: border-box;
                width: 740px;
                height: 100%;
                padding: 5px;
                float: left;
            }

            .right {
                float: left;
                width: 250px;

                .news {
                    border: 1px solid #e4e4e4;
                    margin-top: 5px;

                    h4 {
                        border-bottom: 1px solid #e4e4e4;
                        padding: 5px 10px;
                        margin: 5px 5px 0;
                        line-height: 22px;
                        overflow: hidden;
                        font-size: 14px;

                        .fl {
                            float: left;
                            height: 100%;
                        }

                        .fr {
                            float: right;
                            font-size: 12px;
                            font-weight: 400;
                        }
                    }

                    .news-list {
                        padding: 5px 15px;
                        line-height: 38px;

                        .bold {
                            font-weight: 700;
                        }
                    }
                }
            }
        }
    }
</style>
